public class Date {
    public int year;
    public int month;
    public int day;
    /*
    就地初始化：
    public int year = 1900;
    public int month = 1;
    public int day = 1;
     */
    public Date(){
        this(1900,1,1);
        //this(...)必须是构造方法中的第一条语句；
    }
    //默认初始化：
    public Date(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
        //System.out.println("Date(int,int,int)方法被调用了");
    }
    public void printDate(){
        System.out.println(year+"-"+month+"-"+day);
    }
    public static void main(String[] args){
        //Date d = new Date(2021,6,9);
        Date d = new Date();
        d.printDate();
    }
}
